﻿using Cysharp.Threading.Tasks;
using Framework.Manager;

namespace Framework.Task
{
    public class Task_UnloadResources : Task
    {
        public Task_UnloadResources(int factor) : base(factor, "unload resources")
        {
        }

        protected override async UniTask OnStart()
        {
            ResourceManager.Instance.PrepareUnload();
            ResourceManager.Instance.Unload(false);
            await UIManager.Instance.Dispose();
            await OnFinished();
        }
    }
}